/**
 * 
 */
package com.beta.restapi.internal.converter;

import org.apache.commons.lang3.StringUtils;
import org.springframework.core.convert.converter.Converter;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * @author vector
 *
 */
public class StringToJSONObjectConverter implements Converter<String, JSONObject> {

	@Override
	public JSONObject convert(String source) {
		if (StringUtils.isBlank(source)) {
			return null;
		}
		return JSON.parseObject(source);
	}

}
